import { ChannelListType } from '@/store/reducer/channel';
import request from '@/utils/request';

/** 获取所有频道Api */
export function GetAllChannelApi() {
  return request({
    url: '/v1_0/channels',
  });
}
/** 获取用户频道Api */
export function GetuserChannelApi() {
  return request({
    url: '/v1_0/user/channels',
  });
}

/** 删除指定频道Api */
export function DelChannelApi(id: number) {
  return request({
    url: `/v1_0/user/channels/${id}`,
    method: 'DELETE',
  });
}

/** 添加指定频道 */
export function AdddChannelApi(channels: ChannelListType) {
  return request({
    url: '/v1_0/user/channels',
    method: 'PATCH',
    data: { channels: [channels] },
  });
}
